<template>
    <div id="credit"></div>
    <div id="cesiumContainer"></div>
</template>
<script lang="ts" setup>
import * as Cesium from 'cesium';
import { ACCESS_TOKEN } from '../../utils/constant';
Cesium.Ion.defaultAccessToken = ACCESS_TOKEN;
/**
 * 叠加图层
 */
const initMap = () => {
    // const subdomains = ['0', '1', '2', '3', '4', '5', '6', '7'];
    const viewer = new Cesium.Viewer('cesiumContainer', {
        // 是否显示信息窗口
        infoBox: false,
        // 是否显示查询框
        geocoder: false,
        // 是否显示home按钮
        homeButton: false,
        // 切换3D和2D的按钮
        sceneModePicker: false,
        // 切换图层按钮
        baseLayerPicker: false,
        // 更多帮助按钮
        navigationHelpButton: false,
        // 动画表盘
        animation: false,
        creditContainer: 'credit',
        timeline: false,
        fullscreenButton: false,
        vrButton: false
    });
    // 设置显示fps
    viewer.scene.debugShowFramesPerSecond = false;
    const layer1 = new Cesium.WebMapTileServiceImageryProvider({
        url: 'http://t0.tianditu.com/img_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=30d07720fa76f07732d83c748bb84211',
        layer: 'tdtBasicLayer',
        style: 'default',
        format: 'image/jpeg',
        tileMatrixSetID: 'GoogleMapsCompatible'
    });
    viewer.imageryLayers.addImageryProvider(layer1);
};
onMounted(() => {
    initMap();
});
</script>
<style lang="scss" scoped></style>
